package com.fzk.blog.blog.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author fzk
 * @date 2021-08-14 16:51
 */
@Controller
public class RouterController {

    @GetMapping(path = {"/", "/index.html", "/index"})
    public String toIndex() {
        return "index";
    }

    @GetMapping(path = {"/demo.html", "/demo"})
    public String toDemo() {
        return "demo";
    }

    @GetMapping(path = "/blog/{path}.html")
    public String toBlogDetail(@PathVariable("path") String path) {
        return "blog/" + path;
    }
}
